1. Field of the Invention
The present invention relates to a computer program product, system, and method for prefetching source tracks for destaging updated tracks in a copy relationship.
2. Description of the Related Art
In a storage environment, source volumes may be mirrored to target volumes to provide redundant copies of the source volumes at target volumes. A point-in-time copy replicates data in a manner that appears instantaneous and allows a host to continue accessing the source volume while actual data transfers to the copy volume are deferred to a later time. The point-in-time copy appears instantaneous because complete is returned to the copy operation in response to generating the relationship data structures without copying the data from the source to the target volumes. Point-in-time copy techniques, also referred to as point-in-time copies, such as the IBM FlashCopy® (FlashCopy is a registered trademark of International Business Machines, Corp. or “IBM”) and Snapshot, typically defer the transfer of a data back or track in the source volume at the time the point-in-time copy relationship was established to the copy target volume until a write operation is requested to that data block on the source volume. Data transfers may also proceed as a background copy process with minimal impact on system performance. The point-in-time copy relationships that are immediately established in response to the point-in-time copy command include a bitmap or other data structure indicating the location of blocks in the volume at either the source volume or the copy volume. The point-in-time copy comprises the combination of the data in the source volume and the data to be overwritten by the updates transferred to the target volume.
When an update to a track in the source volume involved in a point-in-time copy relationship is received, the updated track is stored in a cache or memory and subsequently destaged to the source storage according to a cache management algorithm. If the source storage has the copy of the track as of the point-in-time copy, then that copy of the track must be copied to the target volume before the copy of the track in the source storage as of the point-in-time is overwritten. Thus, when performing the destage operation, the source data must be read and transferred to the target volume before the source data is updated. This copy operation is sometimes referred to as a “copy-on-write”.